package org.example.work2.tcc.business.feign;

import io.seata.rm.tcc.api.BusinessActionContext;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 帐户服务
 *
 * @author xh
 * @date 2023/04/03
 */
@FeignClient("tcc-order-service")
@RequestMapping("/order")
public interface OrderClient {

//    @PostMapping("/create")
//    boolean createOrder(@RequestBody Order order);

    @PostMapping("/create")
    boolean createOrder(@RequestBody BusinessActionContext actionContext,
                     @RequestParam("id") Long id,
                     @RequestParam("accountCode") String accountCode,
                     @RequestParam("productId") String productId,
                     @RequestParam("productCounts") Integer productCounts,
                     @RequestParam("totalPrice") Integer totalPrice);

}
